<!DOCTYPE html>
<html>
<head>
    <title>Math Object Random Example 2</title>
    <script type="text/javascript">
        var num = Math.floor(Math.random() * 9 + 2);
        alert(num);    //a number between 2 and 10
        
    </script>
</head>
<body>

</body>
</html>